<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var age = 20;
      var myname = "张三";
      var obj = {
        name: myname,
        age: age,
        fn: function () {
          console.log("fn");
        },
        fn1: function () {
          console.log("fn1");
        },
      };
      console.log(obj);

      // 把这个对象改成 ES6简写形式 ；
      let myHeight = "height";
      var age = 20;
      var myname = "张三";
      var obj = {
        name: myname,
        age,
        fn() {
          console.log("fn");
        },
        fn1() {
          console.log(fn1);
        },
        [myHeight]: "178cm",
      };
      console.log(obj);

      //每个构造函数的原型都会有一个constructor属性  会指向原来的构造器
      let prototype = {
        //系统已经定义好的
        constructor: "原来的构造函数",
      };
      prototype = { name: "123" };
      prototype.constructor = "原来的构造函数";
      console.log(prototype);
    </script>
  </body>
</html>
